/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Priyanka
 */

import org.hibernate.*;
import org.hibernate.cfg.*;

public class testHibernate {
    
	static SessionFactory factory=null;
	static SessionFactory new_factory=null;
	static{
		try
		{
			Configuration cfg=new Configuration();
			//SchemaNamingStrategy sc=new SchemaNamingStrategy();
			//cfg.setNamingStrategy(sc);
			cfg.configure();
			factory=cfg.buildSessionFactory();	
			
			new_factory=new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
		}
		catch(Throwable th)
		{
			System.err.println("Exception");
			th.printStackTrace();
		}
		
	}
	public static SessionFactory getSessionFactory(int param){
		if (param == 0) 
			return factory;
		else
			return new_factory;
	}
	


}
